﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProblemaShowroom
{
    /// <summary>
    /// Singleton & AbstractFactory
    /// Only one sport car manufacturer.
    /// Can create cars of three types: Sedan, Coupe, Mini
    /// </summary>
    class SportCarManufacturer: CarManufacturer
    {
        private static readonly SportCarManufacturer _instance = new SportCarManufacturer();

        private SportCarManufacturer() { }

        public static SportCarManufacturer Instance
        {
            get { return _instance; }
        }

        public override Car GetCar(CarType type)
        {
            string color, transmission;
            GetSpecs(out color, out transmission);

            switch (type)
            {
                case CarType.Coupe:
                    return new SportCoupeCar(color, transmission);
                case CarType.Mini:
                    return new SportMiniCar(color, transmission);
                default:
                    return new SportSedanCar(color, transmission);
            }
        }
    }
}
